﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint.Administration;
using Microsoft.SharePoint;

namespace SharePointOfView.Utilities
{
    public class Version
    {
        private static bool? isMoss = null;

        /// <summary>
        /// Determines if this is a MOSS install.
        /// </summary>
        /// <value><c>true</c> if this instance has MOSS; otherwise, <c>false</c>.</value>
        public static bool IsMOSS
        {
            get
            {
                if (!isMoss.HasValue)
                {
                    SPWebService serv = SPFarm.Local.Services.GetValue<SPWebService>();
                    SPFeature sharedServicesFeature = serv.Features[new Guid("F324259D-393D-4305-AA48-36E8D9A7A0D6")];
                    isMoss = sharedServicesFeature != null;
                }
                return isMoss.Value;
            }
        }

    }
}
